<template>
	<view :class="list && list.length > 0 ? 'listMoudle' : 'listBox'" v-if="list">
		<view class="box"  v-for="(item,index) in list" :key="index" v-if="list.length > 0">
			<view class="top">
				<image :src="'../../../static/img/quickly/apply/apply'+item.type+'@2x.png'"></image>
				<!-- <image src="@/static/img/quickly/apply/apply4@2x.png" v-if="item.type == 4"></image>
				<image src="@/static/img/quickly/apply/apply1@2x.png" v-if="item.type == 1"></image>
				<image src="@/static/img/quickly/apply/apply5@2x.png" v-if="item.type == 5"></image>
				<image src="@/static/img/quickly/apply/apply6@2x.png" v-if="item.type == 6"></image>
				<image src="@/static/img/quickly/apply/apply2@2x.png" v-if="item.type == 2"></image>
				<image src="@/static/img/quickly/apply/apply7@2x.png" v-if="item.type == 7"></image> -->
				<text class="assementNumber">{{item.name}}</text>
				<text class="dataTime">{{item.assessmentDate}}</text>
			</view>
			<view class="bottom">
				<view class="nameBox">
					<text class="userName">{{item.userName}}</text>
				</view>
				<view class="viewAssessment" @click="read(item)">查看申请</view>
			</view>
		</view>
		
		<view class="imageDefault" v-if="list.length <= 0">
			<image src="@/static/img/quickly/apply/default.png"></image>
			<view>您还没有评估申请~</view>
		</view>
	</view>
</template>

<script>
	export default{
		data() {
			return {
				list: []
			}
		},
		created() {
			this.getList({pageIndex:1,pageSize:10})
		},
		methods:{
			getList(data) {
				this.$api.AppMembershipEvaluationList(data).then((res) => {
					this.list = res.data.result && res.data.result.elements
				})
			},
			read(e) {
				if(e.type == 3){
					uni.navigateTo({
						url:`/pages/quickly/psychology/index?id=${e.tid}&selected=1`
					})
				}else if(e.type == 4){
					uni.navigateTo({
						url:`/pages/quickly/healthStatus/accomplishment/add?id=${e.tid}&selected=1`
					})
				}else if(e.type == 1) {
					uni.navigateTo({
						url:`/pages/quickly/healthStatus/lifeStyle/index?id=${e.tid}&selected=1`
					})
				}else if(e.type == 5) {
					uni.navigateTo({
						url:`/pages/quickly/healthStatus/anxious/index?id=${e.tid}&selected=1`
					})
				}else if(e.type == 6) {
					uni.navigateTo({
						url:`/pages/quickly/healthStatus/depressed/index?id=${e.tid}&selected=1`
					})
				}else if(e.type == 2) {
					uni.navigateTo({
						url:`/pages/quickly/healthStatus/examined/index?id=${e.tid}&selected=1`
					})
				}else if(e.type == 7) {
					uni.navigateTo({
						url:`/pages/quickly/healthStatus/chineseMedicine/index?id=${e.tid}&selected=1&userId=${e.userId}`
					})
				}else if(e.type == 8) {
					// 高血压
					uni.navigateTo({
						url:`/pages/futureDiseases/hypertension/index?id=${e.tid}&selected=1&userId=${e.userId}`
					})
				}else if(e.type == 9) {
					// 糖尿病
					uni.navigateTo({
						url:`/pages/futureDiseases/diabetes/index?id=${e.tid}&selected=1&userId=${e.userId}`
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.listMoudle,.listBox {
		width: 750upx;
		min-height: calc(100vh - 44px);
		background-color: #F8F8F8;
		padding: 24upx 0 0;
		.box {
			width: 702;
			height: 100%;
			background: #FFFFFF;
			border-radius: 22upx;
			margin: 0 24upx 25upx;
			padding:0 29upx 0 60upx;
			box-sizing: border-box;
			position: relative;
			.top {
				height: 74upx;
				display: flex;
				align-items: center;
				font-size: 28upx;		
				border-bottom: 1upx solid #CCCCCC;
				image {
					position: absolute;
					left: 16upx;
					width: 30upx;
					height: 30upx;
				}
				.assementNumber {
					flex: 1;
					color: #333333;
					font-size: 30upx;
				}
				.dataTime {
					color: #333333;
					flex: 1;
					text-align: right;
				}
			}
			.bottom {
				display: flex;
				align-items: center;
				height: 97upx;
				.nameBox {
					flex: 1;
					.userName {
						color: #333333;
						font-size: 40upx;
						font-weight: 500;
					}
				}
				.viewAssessment{
					width: 146upx;
					height: 50upx;
					background: #05C6AD;
					border-radius: 25upx;
					color: #FFFFFF;
					font-size: 30upx;
					line-height: 50upx;
					text-align: center;
				}
			}
		}
		.imageDefault {
			image {
				display: table;
				width: 232upx;
				height: 220upx;
				margin: 118upx auto 45upx;
			}
			view {
				color: #666666;
				font-size: 30upx;
				text-align: center;
			}
		}
	}
	.listBox {
		background-color: #FFFFFF;
	}
</style>